﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Text;
using System.Windows.Forms;

namespace WBrowser
{
    public partial class KeyWords : Form
    {
        public KeyWords()
        {
            InitializeComponent();
        }

        private void KeyWords_Load(object sender, EventArgs e)
        {
            // TODO: This line of code loads data into the 'mpconfigDataSet.Types' table. You can move, or remove it, as needed.
            this.typesTableAdapter.Connection.ConnectionString = GeneralClass.ConnectString();
            this.typesTableAdapter.Fill(this.mpconfigDataSet.Types);
            // TODO: This line of code loads data into the 'mpconfigDataSet.Keywords' table. You can move, or remove it, as needed.
            this.keywordsTableAdapter.Connection.ConnectionString = GeneralClass.ConnectString();
            this.keywordsTableAdapter.Fill(this.mpconfigDataSet.Keywords);
        }

        private void btnUpdate_Click(object sender, EventArgs e)
        {
            if (keywordsTableAdapter.Update(this.mpconfigDataSet.Keywords) > 0)
                MessageBox.Show("Update successful!");
        }

        private void comboBox1_SelectedIndexChanged(object sender, EventArgs e)
        {
            keywordsBindingSource.Filter = "KeyType =" + comboBox1.SelectedValue.ToString();
        }
    }
}
